package com.car.service.impl;

import com.car.dao.BillingMapper;
import com.car.entity.Billing;
import com.car.entity.Car;
import com.car.entity.FindVip;
import com.car.service.IBillingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("billingService")
public class BillingService implements IBillingService {

    @Autowired
    @Qualifier("billingMapper")
    public BillingMapper billingMapper;

    @Override
    public List<Billing> findBilling() {
        System.out.println("查询订单");
        return billingMapper.findBilling();
    }

    @Override
    public Billing findByIdBilling(int vid) {
        System.out.println("通过id查询订单");
        return billingMapper.findByIdBilling(vid);
    }

    @Override
    public List<Billing> findByIdPname(int vid) {
        return billingMapper.findByIdPname(vid);
    }


    @Override
    public List<Billing> findByIdSname(int vid) {
        return billingMapper.findByIdSname(vid);
    }

    @Override
    public int deleteSnamePname(int bid) {
        return billingMapper.deleteSnamePname(bid);
    }


    @Override
    public int deleteBilling(int bid) {
        System.out.println("退单");
        return billingMapper.deleteBilling(bid);
    }

    @Override
    public int deleteVip(int bid) {
        return billingMapper.deleteVip(bid);
    }

    @Override
    public int addSname(Billing billing) {
        return billingMapper.addSname(billing);
    }

    @Override
    public int addEmpEname(Billing billing) {
        return billingMapper.addEmpEname(billing);
    }

    @Override
    public int addPname(Billing billing) {
        return billingMapper.addPname(billing);
    }

    @Override
    public List<Billing> findBybilling(String regtime, String jieshu, String phone) {
        return billingMapper.findBybilling(regtime, jieshu, phone);
    }

    @Override
    public int updateBilling(Billing billing) {
        return billingMapper.updateBilling(billing);
    }


    @Override
    public List<FindVip> findVip(int wid) {
        return billingMapper.findVip(wid);
    }

    @Override
    public List<FindVip> findCar(int wid) {
        return billingMapper.findCar(wid);
    }


    @Override
    public int findByVip(String name) {
        return billingMapper.findByVip(name);
    }


    @Override
    public int updateMileage(FindVip findVip) {
        System.out.println("修改车辆里程");
        return billingMapper.updateMileage(findVip);
    }

    @Override
    public Car findByIdCar(int cid) {
        return billingMapper.findByIdCar(cid);
    }

    @Override
    public int updateCar(Car car) {
        System.out.println("编辑爱车");
        return billingMapper.updateCar(car);
    }

    @Override
    public int addCar2(Car car) {
        System.out.println("添加爱车");
        return billingMapper.addCar2(car);
    }

    @Override
    public List<Billing> findEmpEname() {
        return billingMapper.findEmpEname();
    }

    @Override
    public List<Billing> findEmpPname() {
        return billingMapper.findEmpPname();
    }


}
